<template>
  <el-form-item label="" label-width="0px" :prop="prop" :required="required" :rules="rules" >
      <el-input v-model.trim="entity[name]"  v-if="action=='modify'"  :placeholder="placeholder" ></el-input> 
      <div v-if="action!='modify'">{{entity[name]}}</div>
  </el-form-item>
</template>

<script>
export default {
  props: {
    entity: {
      type: Object,
      default: () => {
        return {};
      }
    },
    name: {
      type: String,
      default: ""
    },
    rules: {
      type: Array,
      default: []
    },
    prop: {
      type: String,
      default: ""
    },
    placeholder: {
      type: String,
      default: ""
    },
    required: {
      type: Boolean,
      default: true
    },
    action: {
      type: String,
      default: "view"
    }
  },
  data() {
    return {};
  },
  computed:{
 
  }
};
</script>


<style lang="scss">
.tx-table-input {
  // display: inline-flex;
  // justify-content: center;
  // align-items: center;

}
</style>


